$(document).ready(function() {	
	$('.tipsy').tipsy({gravity: 'w'});
	$("#frmGetCodeAccount").validate({
		errorClass		: 'errorMessage',
		errorElement	: 'span',
		onfocusout		: false,
		onkeyup			: false,
		rules: {
			pgcaemail:{
				required 			: true,
				email				: true
			},
			pcaptcha: {
				required			: true,
				validateCaptcha		: true
			}
		},
		messages: {			
			pgcaemail:{
				required 			: email_required,
				email				: email_invalid
			},
			pcaptcha: {
				required			: captcha_required,
				validateCaptcha		: captcha_invalid
			}
		},
		errorPlacement: function(label, element) {
			var id = element.attr('id');			
			label.insertAfter($('#' + id));			
		}
	});	
	$.validator.addMethod('validateCaptcha', function() {
		var strCaptchaInput = $('#pcaptcha').val();
		return validateCaptcha(strCaptchaInput);
	});
});